package ru.ifmo.rybakov.muclumon;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;

import org.hibernate.annotations.Type;
import org.joda.time.DateTime;

@Entity
@DiscriminatorValue("D")
public class DateTimeValue extends PropertyValue {

	@Column(name = "datetime_value", nullable = false)
	@Type(type = "org.joda.time.contrib.hibernate.PersistentDateTime")
	private DateTime value;

	protected DateTimeValue() {}
	
	public DateTimeValue(Property property, DateTime value) {
		assert (value != null);
		assert (property != null);
		this.value = value;
		setProperty(property);
	}
	
	/**
	 * @return the value
	 */
	public DateTime getValue() {
		return value;
	}

	/**
	 * @param value the value to set
	 */
	public void setValue(DateTime value) {
		this.value = value;
	}
}
